package com.example.plcopne.adapter

import androidx.core.content.ContextCompat
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.example.plcopne.R
import com.example.plcopne.bean.PosiBean

class PosiAdapter : BaseQuickAdapter<PosiBean, BaseViewHolder>(R.layout.item_posi) {
    override fun convert(holder: BaseViewHolder, item: PosiBean) {
        holder.setText(R.id.tv_posi, item.posi)
        holder.setBackgroundColor(
            R.id.cl_base,
            if (item.state == 5) ContextCompat.getColor(context, R.color.colorAccent) else ContextCompat.getColor(context, R.color.colorPrimaryDark)
        )


    }
}